﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using IndyMosaic.Core.Notifications;

namespace IndyMosaic.Core.Extensions
{
    public static class NotificationExtensions
    {
        #region Blog Extensions
        public static MailAddressCollection GetMailAddressCollection(this IEnumerable<Subscriber> subscribers)
        {
            MailAddressCollection addresses = new MailAddressCollection();
            foreach (Subscriber subscriber in subscribers)
            {
                try
                {
                    addresses.Add(new MailAddress(subscriber.Address, subscriber.Name));
                }
                catch { }
            }
            return addresses;
        }
        #endregion
    }
}
